package com.gdufs.secondhandwebsite.dao;

import com.gdufs.secondhandwebsite.entity.TagPost;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;


@SpringBootTest
@RunWith(SpringRunner.class)
public class testTagPostMapper {
//    int createTagPost(TagPost tagPost);
//    List<String> selectByPostId(Long postId);
    @Autowired
    TagPostMapper tagPostMapper;
    @Test
    public void testCreateTagPost(){
        TagPost t1= new TagPost();
        t1.setPostId(1L);
        t1.setTagName("求好物");
        tagPostMapper.createTagPost(t1);
        TagPost t2= new TagPost();
        t2.setPostId(1L);
        t2.setTagName("同城交易");
        tagPostMapper.createTagPost(t2);
    }
    @Test
    public void testselectByPostId(){
        List<String> list = tagPostMapper.selectByPostId(1L);
        for(String a:list){
            System.out.println(a);
        }
    }
}
